﻿
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Administration.aspx.cs" Inherits="ProjectDan.Shell.Views.Administration"
    Title="Administration" MasterPageFile="~/Shared/DefaultMaster.master" %>
<asp:Content ID="content" ContentPlaceHolderID="DefaultContent" Runat="Server">

<script type="text/javascript">
    function index_changed(sender) {
        document.getElementById('txtHeader').value = document.getElementById(sender+'_head').value;
        document.getElementById('txtDescription').value = document.getElementById(sender + '_descr').value;
        document.getElementById('txtKey').value = document.getElementById('dictionary_listbox').childNodes(listbox.selectedIndex+1).value;
    }
    function update() {
        var listbox = document.getElementById('dictionary_listbox');
        var listboxitem = listbox.childNodes(listbox.selectedIndex+1);
        
        alert('hi' + listboxitem.value);
        return false;
    }
</script>
		<h1>Administration</h1>
        
        <span style="text-decoration: underline">Manage Popups and Descriptions</span><br />
        
        <asp:Table ID="Table1" runat="server" Width="527px">
            <asp:TableRow>
                <asp:TableCell>
                    <% Resources resources = new Resources(); %>
                    <select id="dictionary_listbox" size="10">
                        <% foreach (KeyValuePair<string, DescriptionPopup> kvp in resources.HelpMessages)
                           {
                               Response.Write("<option value=\"" + kvp.Key + "\" onclick=\"index_changed('" + kvp.Key + "')\">" + kvp.Key + "</option>"); 
                           }  %>
                    </select>
                    
                </asp:TableCell>
                <asp:TableCell VerticalAlign="Top">

                        <input type="hidden" id="txtKey" />
                        Header<br />
                        <input type="text" id="txtHeader" size="50" />
                        <br /><br />
                        Description<br />
                        <textarea rows="5" cols="70" id="txtDescription"></textarea>
                        <br />
                        <asp:Button ID="btnUpdate" runat="server" Text="Update" Width="100px" />

                </asp:TableCell>
                
            </asp:TableRow>
        </asp:Table>
        <%--<asp:TextBox ID="txtError" runat="server" Width="482px"></asp:TextBox>--%>
        <br />
        

</asp:Content>
